package com.xiao.framework.ds.autoconfigure;

import org.springframework.util.StringUtils;

/**
 * @author <a href="mailto:xiaoquanidea@163.com">Aiden</a>
 * @since 2020-02-29 0:04
 */
public class MultiDatasourceBanner {

  public void printBanner(){
    String version = MultiDatasourceBanner.getVersion();
    System.out.println(
          "  ____                              _           ____        _\n"
        + " |  _ \\ _   _ _ __   __ _ _ __ ___ (_) ___     |  _ \\  __ _| |_ __ _ ___  ___  _   _ _ __ ___ ___\n"
        + " | | | | | | | '_ \\ / _` | '_ ` _ \\| |/ __|    | | | |/ _` | __/ _` / __|/ _ \\| | | | '__/ __/ _ \\\n"
        + " | |_| | |_| | | | | (_| | | | | | | | (__     | |_| | (_| | || (_| \\__ \\ (_) | |_| | | | (_|  __/\n"
        + " |____/ \\__, |_| |_|\\__,_|_| |_| |_|_|\\___|    |____/ \\__,_|\\__\\__,_|___/\\___/ \\__,_|_|  \\___\\___|\n"
        + "        |___/");
    System.out.println(
          "                                                           "
        + (StringUtils.isEmpty(version)? "":"dynamic datasource version on " + version + ", ") + "designed by xiao ");
  }

  public static String getVersion(){
    Package pck = MultiDatasourceBanner.class.getPackage();
    return pck!=null ? pck.getImplementationVersion():null;
  }
  public static void main(String[] args) {
    new MultiDatasourceBanner().printBanner();
  }
}


